﻿@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>Index</title>
    @if (false)
    {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
  
  <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
    @Html.DevExpress().GetStyleSheets(
     new StyleSheet { ExtensionType = ExtensionType.ReportToolbar, Theme = DevExpressHelper.Theme },
                new StyleSheet { ExtensionType = ExtensionType.ReportViewer, Theme = DevExpressHelper.Theme }


)
    @Html.DevExpress().GetScripts(
             new Script { ExtensionType = ExtensionType.ListBox },
                    new Script { ExtensionType = ExtensionType.ReportViewer },
                             new Script { ExtensionType = ExtensionType.ReportToolbar }

    )

    <script type="text/javascript">

        function OnBeginCallback(s, e) {
            e.customArgs["yyyy"] = $("#hidyyyy").val();
            e.customArgs["mm"] = $("#hidmm").val();
            e.customArgs["type"] = $("#hidtype").val();

            e.customArgs["nsr"] = $('#hidnsr').val();
            e.customArgs["sfz"] = $('#hidsfz').val();
            e.customArgs["btbl"] = $('#hidbtbl').val();
            e.customArgs["khyh"] = $('#hidkhyh').val();
            e.customArgs["btrq"] = $('#hidbtrq').val();
            e.customArgs["sz"] = $('#hidsz').val();
        }

        function search() {
            var clientSearch = ASPxClientTextBox.Cast("Search");
            var setrq = clientSearch.GetText();
            window.location.href = rootPath + "/Admin/Print/Index?yyyy="
                        + $("#hidyyyy").val() + "&mm=" + $("#hidmm").val() + "&nsr=" + $("#hidnsr").val() + "&sfz="
                        + $("#hidsfz").val() + "&btbl=" + $("#hidbtbl").val() + "&khyh=" + $("#hidkhyh").val() + "&btrq=" + $("#hidbtrq").val()
                        + "&sz=" + $("#hidsz").val()
                        + "&type=FWMMCZBT&setrq=" + setrq;
        }
    </script>
</head>


<body>
 <div>
        @Html.DevExpress().ReportToolbar(settings =>
   {
       // The following settings are necessary for a Report Toolbar. 
       settings.Name = "ReportToolbar";
       settings.ReportViewerName = "reportViewer1";
       
       settings.Items.AddRange(new ReportToolbarItem[] {
        //new ReportToolbarButton { ItemKind = ReportToolbarItemKind.Search },
        new ReportToolbarSeparator(),
        new ReportToolbarButton { ItemKind = ReportToolbarItemKind.PrintReport,ToolTip="直接打印" },
        new ReportToolbarButton { ItemKind = ReportToolbarItemKind.PrintPage,ToolTip="打印当前页" },
        new ReportToolbarSeparator(),
        new ReportToolbarButton { ItemKind = ReportToolbarItemKind.FirstPage,ToolTip="第一页" },
        new ReportToolbarButton { ItemKind = ReportToolbarItemKind.PreviousPage,ToolTip="上一页" },
        new ReportToolbarLabel { ItemKind = ReportToolbarItemKind.PageLabel,Text="页码"},
        new ReportToolbarComboBox { ItemKind = ReportToolbarItemKind.PageNumber, 
            Width = 65 },
        new ReportToolbarLabel { ItemKind = ReportToolbarItemKind.OfLabel,Text="~" },
        new ReportToolbarTextBox() { ItemKind = ReportToolbarItemKind.PageCount},
        new ReportToolbarButton { ItemKind = ReportToolbarItemKind.NextPage,ToolTip="下一页" },
        new ReportToolbarButton { ItemKind = ReportToolbarItemKind.LastPage, ToolTip="最后一页"},
        // new ReportToolbarButton { ItemKind = ReportToolbarItemKind.SaveToDisk },
        //new ReportToolbarButton { ItemKind = ReportToolbarItemKind.SaveToWindow },
        // new ReportToolbarTextBox() { ItemKind = ReportToolbarItemKind.Custom, 
        //    Text = "Search", Name = "Search", Width = new System.Web.UI.WebControls.Unit(70, System.Web.UI.WebControls.UnitType.Pixel)},
        //new ReportToolbarButton { ItemKind = ReportToolbarItemKind.Custom, 
        //    Text = "改变日期", Name="CustomButton" },

    });

       //settings.ClientSideEvents.ItemClick = "function(s, e) {if(e.item.name =='CustomButton' )search() }";
       
   }).GetHtml()
    </div>
    <div>
       <table align="center">
        <tr>
         <td>                    
             @Html.DevExpress().TextBox(settings => {
      
               settings.Name = "Search";
               settings.ControlStyle.CssClass = "left";
               settings.Text = ViewData["Param_PrintDate"].ToString();
               settings.Width = 120;
               settings.Height = 25;
             }).GetHtml()
       </td>
       <td>
        @Html.DevExpress().Button(settings =>
            {
                settings.Name = "btnSearch";
                settings.Text = "改变日期";
                settings.ControlStyle.CssClass = "left";
                settings.Height = 25;
                //settings.Images.Image.Url = Url.Content("~/Content/ControlImages/search.png");
                settings.ClientSideEvents.Click = "search";
            }).GetHtml()
            </td>
        </tr>        
        </table>    
    </div>
    <div>

         @Html.Partial("FwmmszbtReportViewerPartial")  

        @Html.Hidden("hidtype", ViewData["type"])
        @Html.Hidden("hidyyyy", ViewData["yyyy"])
        @Html.Hidden("hidmm", ViewData["mm"])
        @Html.Hidden("hidnsr", ViewData["nsr"])
        @Html.Hidden("hidsfz", ViewData["sfz"])
        @Html.Hidden("hidbtbl", ViewData["btbl"])
        @Html.Hidden("hidkhyh", ViewData["khyh"])
        @Html.Hidden("hidbtrq", ViewData["btrq"])
        @Html.Hidden("hidsz", ViewData["sz"])
    </div>
</body>
</html>
